result = ''
count = 0
count_str = ''
file = open('D:\\data.txt', 'r')
try:
    text_lines = file.readlines()
    # print(type(text_lines), text_lines)
    for line in text_lines:
        # print(type(line), line)
        result = result + line.strip() + ','
        count = count + 1
        count_str = count_str + str(count) + ','
finally:
    file.close()

print('result======', result)
print('count_str======', count_str)
